home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / AOCE / Development Tools / Sample Code / Standard Catalog Package / DTS AddressOMatic / Src / IconSuite.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-28  |  8.0 KB  |  318 lines  |  [TEXT/KAHL]

  1. /*
  2.     File:        Icons.h
  3.  
  4.     Contains:    Public C Interfaces for color icon plotting routines
  5.  
  6.     Copyright:    © 1990, 1992 by Apple Computer, Inc., all rights reserved.
  7.  
  8. */
  9.  
  10. #ifndef __ICONS__
  11. #define __ICONS__
  12.  
  13. #ifndef __TYPES__
  14. #include <Types.h>
  15. #endif
  16.  
  17. #ifndef __QUICKDRAW__
  18. #include <QuickDraw.h>
  19. #endif
  20.  
  21. enum {
  22.  
  23.  
  24. /* The following are icons for which there are both icon suites and SICNs. */
  25.  genericDocumentIconResource = -4000,
  26.  genericStationeryIconResource = -3985,
  27.  genericEditionFileIconResource = -3989,
  28.  genericApplicationIconResource = -3996,
  29.  genericDeskAccessoryIconResource = -3991,
  30.  
  31.  genericFolderIconResource = -3999,
  32.  privateFolderIconResource = -3994,
  33.  
  34.  floppyIconResource = -3998,
  35.  trashIconResource = -3993,
  36.  
  37. /* The following are icons for which there are SICNs only. */
  38.  desktopIconResource = -3992,
  39.  openFolderIconResource = -3997,
  40.  genericHardDiskIconResource = -3995,
  41.  genericFileServerIconResource = -3972,
  42.  genericSuitcaseIconResource = -3970,
  43.  genericMoverObjectIconResource = -3969,
  44.  
  45. /* The following are icons for which there are icon suites only. */
  46.  genericPreferencesIconResource = -3971,
  47.  genericQueryDocumentIconResource = -16506,
  48.  genericExtensionIconResource = -16415,
  49.  
  50.  systemFolderIconResource = -3983,
  51.  appleMenuFolderIconResource = -3982
  52. };
  53. enum {
  54.  startupFolderIconResource = -3981,
  55.  ownedFolderIconResource = -3980,
  56.  dropFolderIconResource = -3979,
  57.  sharedFolderIconResource = -3978,
  58.  mountedFolderIconResource = -3977,
  59.  controlPanelFolderIconResource = -3976,
  60.  printMonitorFolderIconResource = -3975,
  61.  preferencesFolderIconResource = -3974,
  62.  extensionsFolderIconResource = -3973,
  63.  
  64.  fullTrashIconResource = -3984
  65.  
  66.  
  67. #define large1BitMask 'ICN#'
  68. #define large4BitData 'icl4'
  69. #define large8BitData 'icl8'
  70. #define small1BitMask 'ics#'
  71. #define small4BitData 'ics4'
  72. #define small8BitData 'ics8'
  73. #define mini1BitMask 'icm#'
  74. #define mini4BitData 'icm4'
  75. #define mini8BitData 'icm8'
  76. };
  77.  
  78. /*  alignment type values  */
  79. typedef short    IconAlignmentType;
  80.  
  81. enum {
  82. atNone = 0x0,
  83. atVerticalCenter = 0x1,
  84. atTop = 0x2,
  85. atBottom = 0x3,
  86. atHorizontalCenter = 0x4,
  87. atAbsoluteCenter = (atVerticalCenter | atHorizontalCenter),
  88. atCenterTop = (atTop | atHorizontalCenter),
  89. atCenterBottom = (atBottom | atHorizontalCenter),
  90. atLeft = 0x8,
  91. atCenterLeft = (atVerticalCenter | atLeft),
  92. atTopLeft = (atTop | atLeft),
  93. atBottomLeft = (atBottom | atLeft),
  94. atRight = 0xC,
  95. atCenterRight = (atVerticalCenter | atRight),
  96. atTopRight = (atTop | atRight),
  97. atBottomRight = (atBottom | atRight)
  98. };
  99.  
  100. /*  transform type values  */
  101. typedef short    IconTransformType;
  102.  
  103. enum {
  104. ttNone = 0x0,
  105. ttDisabled = 0x1,
  106. ttOffline = 0x2,
  107. ttOpen = 0x3,
  108. ttLabel1 = 0x0100,
  109. ttLabel2 = 0x0200,
  110. ttLabel3 = 0x0300,
  111. ttLabel4 = 0x0400,
  112. ttLabel5 = 0x0500,
  113. ttLabel6 = 0x0600,
  114. ttLabel7 = 0x0700,
  115. ttSelected = 0x4000,
  116. ttSelectedDisabled = (ttSelected | ttDisabled),
  117. ttSelectedOffline = (ttSelected | ttOffline),
  118. ttSelectedOpen = (ttSelected | ttOpen)
  119. };
  120.  
  121. /*  Selector mask values  */
  122. #ifndef __IconSelectorValue__
  123. #define __IconSelectorValue__
  124. typedef unsigned long    IconSelectorValue;
  125. #endif
  126.  
  127. enum {
  128. svLarge1Bit = 0x00000001,
  129. svLarge4Bit = 0x00000002,
  130. svLarge8Bit = 0x00000004,
  131. svSmall1Bit = 0x00000100,
  132. svSmall4Bit = 0x00000200,
  133. svSmall8Bit = 0x00000400,
  134. svMini1Bit = 0x00010000,
  135. svMini4Bit = 0x00020000,
  136. svMini8Bit = 0x00040000,
  137. svAllLargeData = 0x000000ff,
  138. svAllSmallData = 0x0000ff00,
  139. svAllMiniData = 0x00ff0000,
  140. svAll1BitData = (svLarge1Bit | svSmall1Bit | svMini1Bit),
  141. svAll4BitData = (svLarge4Bit | svSmall4Bit | svMini4Bit),
  142. svAll8BitData = (svLarge8Bit | svSmall8Bit | svMini8Bit),
  143. svAllAvailableData = 0xffffffff
  144. };
  145. /*
  146.  * Temp to work around a problem in OCEStandardDirectory.h
  147.  */
  148. #define svLarge1Bit    svLarge1Bit
  149.  
  150. typedef pascal OSErr (*IconAction)(ResType theType, Handle *theIcon, void *yourDataPtr);
  151. typedef pascal Handle (*IconGetter)(ResType theType, void *yourDataPtr);
  152.  
  153. #ifdef __cplusplus
  154. extern "C" {
  155. #endif
  156.  
  157. pascal OSErr PlotIconID(const Rect *theRect,
  158.                             IconAlignmentType align,
  159.                             IconTransformType transform,
  160.                             short theResID)
  161.     = {0x303C, 0x0500, 0xABC9};
  162.     
  163. pascal OSErr NewIconSuite(Handle *theIconSuite)
  164.     = {0x303C, 0x0207, 0xABC9};
  165.     
  166. pascal OSErr AddIconToSuite(Handle theIconData,
  167.                             Handle theSuite,
  168.                             ResType theType)
  169.     = {0x303C, 0x0608, 0xABC9};
  170.     
  171. pascal OSErr GetIconFromSuite(Handle *theIconData,
  172.                             Handle theSuite,
  173.                             ResType theType)
  174.     = {0x303C, 0x0609, 0xABC9};
  175.     
  176. pascal OSErr ForEachIconDo(Handle theSuite,
  177.                             IconSelectorValue selector,
  178.                             IconAction action,
  179.                             void *yourDataPtr)
  180.     = {0x303C, 0x080A, 0xABC9};
  181.     
  182. pascal OSErr GetIconSuite(Handle *theIconSuite,
  183.                             short theResID,
  184.                             IconSelectorValue selector)
  185.     = {0x303C, 0x0501, 0xABC9};
  186.     
  187. pascal OSErr DisposeIconSuite(Handle theIconSuite,
  188.                             Boolean disposeData)
  189.     = {0x303C, 0x0302, 0xABC9};
  190.     
  191. pascal OSErr PlotIconSuite(const Rect *theRect,
  192.                             IconAlignmentType align,
  193.                             IconTransformType transform,
  194.                             Handle theIconSuite)
  195.     = {0x303C, 0x0603, 0xABC9};
  196.     
  197. pascal OSErr MakeIconCache(Handle *theHandle,
  198.                             IconGetter makeIcon,
  199.                             void *yourDataPtr)
  200.     = {0x303C, 0x0604, 0xABC9};
  201.     
  202. pascal OSErr LoadIconCache(const Rect *theRect,
  203.                             IconAlignmentType align,
  204.                             IconTransformType transform,
  205.                             Handle theIconCache)
  206.     = {0x303C, 0x0606, 0xABC9};
  207.  
  208. pascal OSErr PlotIconMethod(const Rect *theRect,
  209.                             IconAlignmentType align,
  210.                             IconTransformType transform,
  211.                             IconGetter theMethod,
  212.                             void *yourDataPtr)
  213.     = {0x303C, 0x0805, 0xABC9};
  214.     
  215. pascal OSErr GetLabel(short labelNumber,
  216.                             RGBColor *labelColor,
  217.                             Str255 labelString)
  218.     = {0x303c, 0x050B, 0xABC9};
  219.     
  220. pascal Boolean PtInIconID(Point testPt,
  221.                             Rect *iconRect,
  222.                             IconAlignmentType alignment,
  223.                             short iconID)
  224.     = {0x303c, 0x060D, 0xABC9};
  225.     
  226. pascal Boolean PtInIconSuite(Point testPt,
  227.                             Rect *iconRect,
  228.                             IconAlignmentType alignment,
  229.                             Handle theIconSuite)
  230.     = {0x303c, 0x070E, 0xABC9};
  231.     
  232. pascal Boolean PtInIconMethod(Point testPt,
  233.                             Rect *iconRect,
  234.                             IconAlignmentType alignment,
  235.                             IconGetter theMethod,
  236.                             void *yourDataPtr)
  237.     = {0x303c, 0x090F, 0xABC9};
  238.     
  239. pascal Boolean RectInIconID(Rect *testRect,
  240.                             Rect *iconRect,
  241.                             IconAlignmentType alignment,
  242.                             short iconID)
  243.     = {0x303c, 0x0610, 0xABC9};
  244.     
  245. pascal Boolean RectInIconSuite(Rect *testRect,
  246.                             Rect *iconRect,
  247.                             IconAlignmentType alignment,
  248.                             Handle theIconSuite)
  249.     = {0x303c, 0x0711, 0xABC9};
  250.     
  251. pascal Boolean RectInIconMethod(Rect *testRect,
  252.                             Rect *iconRect,
  253.                             IconAlignmentType alignment,
  254.                             IconGetter theMethod,
  255.                             void *yourDataPtr)
  256.     = {0x303c, 0x0912, 0xABC9};
  257.     
  258. pascal OSErr IconIDToRgn(RgnHandle theRgn,
  259.                             Rect *iconRect,
  260.                             IconAlignmentType alignment,
  261.                             short iconID)
  262.     = {0x303c, 0x0613, 0xABC9};
  263.     
  264. pascal OSErr IconSuiteToRgn(RgnHandle theRgn,
  265.                             Rect *iconRect,
  266.                             IconAlignmentType alignment,
  267.                             Handle theIconSuite)
  268.     = {0x303c, 0x0714, 0xABC9};
  269.     
  270. pascal OSErr IconMethodToRgn(RgnHandle theRgn,
  271.                             Rect *iconRect,
  272.                             IconAlignmentType alignment,
  273.                             IconGetter theMethod,
  274.                             void *yourDataPtr)
  275.     = {0x303c, 0x0915, 0xABC9};
  276.     
  277. pascal OSErr SetSuiteLabel(Handle theSuite, short theLabel)
  278.     = {0x303C, 0x0316, 0xABC9};
  279.  
  280. pascal short GetSuiteLabel(Handle theSuite)
  281.     = {0x303C, 0x0217, 0xABC9};
  282.  
  283. pascal OSErr GetIconCacheData(Handle theCache, void **theData)
  284.     = {0x303C, 0x0419, 0xABC9};
  285.         
  286. pascal OSErr SetIconCacheData(Handle theCache, void *theData)
  287.     = {0x303C, 0x041A, 0xABC9};
  288.         
  289. pascal OSErr GetIconCacheProc(Handle theCache, IconGetter *theProc)
  290.     = {0x303C, 0x041B, 0xABC9};
  291.         
  292. pascal OSErr SetIconCacheProc(Handle theCache, IconGetter theProc)
  293.     = {0x303C, 0x041C, 0xABC9};
  294.     
  295. pascal OSErr PlotIconHandle(const Rect *theRect,
  296.                             IconAlignmentType align,
  297.                             IconTransformType transform,
  298.                             Handle theIcon)
  299.     = {0x303C, 0x061D, 0xABC9};
  300.     
  301. pascal OSErr PlotSICNHandle(const Rect *theRect,
  302.                             IconAlignmentType align,
  303.                             IconTransformType transform,
  304.                             Handle theSICN)
  305.     = {0x303C, 0x061E, 0xABC9};
  306.     
  307. pascal OSErr PlotCIconHandle(const Rect *theRect,
  308.                             IconAlignmentType align,
  309.                             IconTransformType transform,
  310.                             CIconHandle theCIcon)
  311.     = {0x303C, 0x061F, 0xABC9};
  312.     
  313. #ifdef __cplusplus
  314. }
  315. #endif
  316.  
  317. #endif
  318.